package com.mujin.keji.collectionsystem.module.outboundtask.viewmodel;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModel;
import android.support.annotation.Nullable;

import com.mujin.keji.collectionsystem.base.BaseDto;
import com.mujin.keji.collectionsystem.module.outboundtask.dto.MarkDto;
import com.mujin.keji.collectionsystem.module.outboundtask.repository.IMarkRepository;
import com.mujin.keji.collectionsystem.module.outboundtask.repository.MarkRepository;
import com.mujin.keji.collectionsystem.module.outboundtask.vo.MarkVo;

/**
 * 催收记录viewmodel
 *
 * @author weishixiong
 * @Time 2018-05-14
 */
public class MarkViewModel extends ViewModel {
    private LiveData<BaseDto<MarkDto>> liveData;
    private IMarkRepository markRepository;


    public LiveData<BaseDto<MarkDto>> getLiveData(MarkVo vo) {
        queryMark(vo);
        return liveData;
    }

    /**
     * 查询催收记录
     *
     * @param vo
     */
    public void queryMark(MarkVo vo) {
        markRepository = new MarkRepository();
        this.liveData = markRepository.queryMark(vo);

    }
}
